import json
data = [{"name":"lisi","age":15},{"name":"zhangsan","age":15},{"name":"章三","age":15}]

#使用json包中的dumps将列表转为json
json_str = json.dumps(data,ensure_ascii=False)
print(type(json_str))
print(json_str)

#使用loads将json字符串转为list
str_ = '[{"name": "lisi", "age": 15}, {"name": "zhangsan", "age": 15}, {"name": "章三", "age": 15}]'
json_list = json.loads(str_)
print(json_list[1])
print(type(json_list[1]))


